<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../../../css/mui.min.css" rel="stylesheet" />
		<link href="../../css/common.css" rel="stylesheet" />
        <title></title>
	</head>
		
	 <body>
		<div class="container" id="container">
		  <header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">课件预览</h1>
		  </header>
		  <div class="mui-content" id="mui-content">
			
		  </div>
		</div>
	</body>
	<script src="../../../../js/mui.min.js"></script>
    <script src="../build/pdf.js"></script>
	<script>
	mui.init();
	mui.plusReady(function() {
		var self = plus.webview.currentWebview();
		var file = self.file
		plus.nativeUI.showWaiting('文件加载中...');
		var dtask = plus.downloader.createDownload(file, {retryInterval:10}, function(d, status){
			plus.nativeUI.closeWaiting();
			if(status == 200){
				var fileSaveUrl = plus.io.convertLocalFileSystemURL(d.filename);
				var iframe = document.createElement('iframe')
				iframe.id='pdfContainer'
				iframe.width="100%"
				iframe.height="1000px"
				iframe.setAttribute('frameborder',0)
				iframe.src = "viewer.html?file="+fileSaveUrl
				document.getElementById('mui-content').appendChild(iframe)
			}else{
				plus.nativeUI.alert("下载失败！");
			}
		})
		dtask.start()
	})
	</script>
</html>
